import { computed } from 'vue'
import type { TableColumnsType } from 'ant-design-vue'
import type { File as FileData } from '@/types/api/file'

/**
 * 获取文件表格列配置
 * @returns 表格列配置
 */
export const useFileTableColumns = () => {

  const { t } = useI18n()

  return computed<TableColumnsType<FileData>>(() => [
    {
      title: t('file.fileName'),
      dataIndex: 'fileName',
      key: 'fileName',
      width: 150,
      ellipsis: true
    },
    {
      title: t('file.uploader'),
      dataIndex: 'uploaderName',
      key: 'uploaderName',
      width: 100,
      ellipsis: true
    },
    {
      title: t('file.fileType'),
      dataIndex: 'fileType',
      key: 'fileType',
      width: 80,
      ellipsis: true
    },
    {
      title: t('file.uploadTime'),
      dataIndex: 'createTime',
      key: 'createTime',
      width: 180
    },
    {
      title: t('common.action'),
      key: 'action',
      width: 280,
      fixed: 'right'
    }
  ])
} 